< previous page page_78 next page >

Page 78
What Are Bound Data Controls?
Before you get into the details of listing the properties, events, and methods of Visual Basic bound data controls, let's review what a bound control is and why it's so useful.
Bound data controls are the same as any other Visual Basic control objects, except that they have been given additional properties, events, and methods that allow you to "bind" them directly to one or more data tables. This binding makes it easy to create data-aware input and display objects that you can use to perform data input and display with very little program code. Using bound controls simplifies your programming chores a great deal. Most bound controls automatically handle the various chores related to processing data entry and display for databases. The bound controls make it easy to write Visual Basic programs that handle all (or nearly all) of the following processes:
· Loading data from the database into a Visual Basic data object
· Selecting the data record(s) requested by the user
· Loading form controls with values in the requested record(s)
· Trapping simple user input errors
· Enforcing database integrity rules
· Updating the data object with modified data from the form controls
You do not need to use bound data controls in your database programs. In fact, as you will see in the lessons next week, there are times when it is better to use unbound controls in your programs. However, when you use unbound controls, you need to take responsibility for handling all the processes outlined in the preceding list. Although this is not an insurmountable task, it's a good idea to take advantage of the power of bound data controls whenever possible. Using the prebuilt and tested bound controls helps you create solid, functional database entry forms in a short period of time.
The Data Control
The Visual Basic data control is the control used to gain access to database tables. The data control allows you to establish a link to a single Dynaset data object in a database. You can have more than one data control in your program and more than one data control on a single form.
Like all Visual Basic controls, there are properties, events, and methods associated with the data control. Because this book is on databases, this lesson will focus on the properties, events, and methods that are important in dealing with database activity. In the process, you will build a small program that illustrates these database-related aspects of the Visual Basic data control.

 
< previous page page_78 next page >

If you like this book, buy it!